import request from '@/utils/request'

// 查询列表
export function listCategory(query) {
  return request({
    url: '/category/pageList',
    method: 'post',
    params: query
  })
}

// 查询详细
export function getCategory(id) {
  return request({
    url: '/category/getinfo/' + id,
    method: 'get'
  })
}

// 查询下拉树结构
export function treeselect() {
  return request({
    url: '/category/treeselect',
    method: 'get'
  })
}

// 新增
export function addCategory(data) {
  return request({
    url: '/category/create',
    method: 'post',
    data: data
  })
}

// 修改
export function updateCategory(data) {
  return request({
    url: '/category/update/',
    method: 'post',
    data: data
  })
}

// 删除
export function delCategory(id) {
  return request({
    url: '/category/remove/' + id,
    method: 'get'
  })
}